package lekcja3.zadanie2;

/**
 * Pętle
 */
public class Zadanie2 {
    public static void main(String[] args) {
        petlaFor();
        petlaWhile();
        petlaDoWhile();
    }

    public static void petlaFor(){
        System.out.println("Pętla for");

        for (int i = 1; i <= 5;  i++){
            System.out.println(i);
        }
    }

    public static void petlaWhile(){
        System.out.println("Pętla while");
        int i = 1;

        while (i <= 5){
            System.out.println(i);
            i++;
        }
    }

    public static void petlaDoWhile(){
        System.out.println("Pętla do while");
        int i = 1;

        do {
            System.out.println(i);
            i++;
        } while (i <= 5);

    }
}